package com.loan.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.loan.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
    /**
     * @FBF
     * 用户修改头像接口
     * @param
     * @return
     */
    @Update("UPDATE user SET icon=#{icon} WHERE username=#{username}")
    public int updateIcon(User user);

    /**
     *用户信息完善
     * @param user
     * @return
     */
    @Update("UPDATE user SET card_id=#{cardId},NAME=#{name},gender=#{gender},age=#{age},address=#{address},lockd='n' WHERE username=#{username} ")
    public int updateUser(User user);
    @Select("SELECT * FROM user u LEFT JOIN customer c ON u.id=c.user_id WHERE c.user_id IS NULL")
    List<User> listNoEmp();
}
